import {
    reqSort
} from "../../api/index"
Page({
    data: {
        active: 0,
        sortArr: [],
    },
    changeActive(event) {
        this.setData({
            active: event.currentTarget.dataset.index
        })
    },
    onLoad() {
        this.getData()
    },
    async getData() {
        const result = await reqSort()
        if (result.code == 200) {
            this.setData({
                sortArr: result.data
            })
        }
    },
    // 点击右侧分类，进入商品列表
    findGoods(event) {
        wx.navigateTo({
            url:`/pages/goods/goods?category2Id=${event.currentTarget.dataset.category2id}`,
        })
    }
})